<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登陆后台管理中心</title>
<link type="text/css" rel="stylesheet" href="__ROOT__/admin/tpl/public/style/{$hd.session.style}.css"/>
<css file="__ROOT__/admin/tpl/public/css/common.css"/>
<style>
body{
	background:url(__ROOT__/admin/tpl/public/images/background.png);	
}
#loginWindow{
	width:420px;
	height:auto;
	margin:180px auto;
	background:#FFF;
	padding-bottom:10px;
}
#loginWindow h1{
	height:34px;
	width:100%;
	background:url(__ROOT__/admin/tpl/public/images/header_inner.png) repeat-x 0px 0px;
	color:#FFF;	
	text-indent:16px;
	line-height:2.2em;
	font-size:16px;	
}
#loginWindow dl{
	width:90%;
	margin:5%;
	height:auto;
	border-bottom:1px solid #dddddd;
	position:relative;
	margin-bottom:10px;
}

#loginWindow dl dd{
	width:100%;
	height:25px;
	margin:10px 0px;
	position:relative;
	
}

#loginWindow dl dd strong{
	font-size:12px;
	display:block;
	float:left;
	width:20%;
	text-align:right;
}
#loginWindow dl dd span{

	display:block;
	float:left;

	text-align:left;
}
dl dd .inputTex {
    border: 1px solid #d5d5d5;
    width: 50%;
    height: 25px;
    text-indent: 5px;
    -moz-box-shadow: 2px 2px 2px #999 inset;
    -webkit-box-shadow: 2px 2px 2px #999 inset;
    box-shadow: 2px 2px 2px #999 inset;
    font-size: 14px;
    font-weight: bold;
    font-family: "Arial Black";
    color: #666;
	float:left;
}
#loginWindow p{
	width:100%;
	height:25px;
}
#loginWindow p a{
	display:block;
	float:left;
	left:0px;
	font-size:12px;
	color:#999;
	margin-left:25px;
	
}
#loginWindow p .submitlogin{
	width:auto;
	height:24px;
	border:1px solid #FFF;
	border-radius: 3px;
	padding:1px 8px;		
	cursor:pointer;
	float:right;
	margin-right:25px;

}
</style>
<jquery/>
<script>
$(function(){
	$("#codeImg").click(function(){		
		rd_code();
	})
	var checkState = false;
	var stateImgSrc = $('#stateImg').attr('src');
	$("[name = code]").blur(function(){
		var data = 'code='+$(this).val();		
		var url = $(this).attr('ajaxUrl');
		$.ajax({
			type:'POST',
			url:url,
			data:data,
			success: function(data){
				if(data == 1){
					$('#stateImg').css({display:'block'})
					$('#stateImg').attr('src',stateImgSrc+'right.png');
					checkState=true;
				}else{
					$('#stateImg').css({display:'block'})
					$('#stateImg').attr('src',stateImgSrc+'error.png');
				}
			}			
		})		
	})
	$("#loginForm").submit(function(){
		if($('[name=username]').val() == ''){
			alert('用户名不能为空');
			$('[name=username]').css({background:'#91e8f8'})
			return false;
		}
		if($('[name=password]').val() == ''){
			alert('密码不能为空');
			$('[name=password]').css({background:'#91e8f8'})
			return false;
		}
		
		if(!checkState){
			alert('验证码输入错误');
			$('[name=code]').css({background:'#91e8f8'})
			return false;
		}
	})
	
})
function rd_code(){
    var src = $("#codeImg").attr('src') + "?d=" + Math.random();  
    $("#codeImg").attr('src', src);
}

	
</script>
</head>
<body>
<div id="loginWindow">
	<h1>登陆到后台管理中心</h1>
	<form id="loginForm" action="__CONTROL__/login" method="post" >
	<dl>		
		<dd><strong>用户名：</strong><input class='inputTex' type="text" name="username" /></dd>
		<dd><strong>密码：</strong><input class='inputTex' type="password" name="password" /></dd>						
		<dd>
			<strong>验证码：</strong>
			<input class='inputTex' style="width:80px;" ajaxUrl='__CONTROL__/checkCode'  type="text" name="code" />
			<span style='padding-left:15px;'><img id="codeImg"  height=28 src="__CONTROL__/showCode"></span>
			<span style='padding-left:15px;'><img id='stateImg' style='display:none;'  src="__ROOT__/admin/tpl/public/images/"></span>
		</dd>					
		<dd>
			<strong >&nbsp;</strong><input style='float:left;' type="checkbox" >
			<span style=" padding-left:10px;color:#999; ">记住密码</span>
		</dd>
	</dl>
	<p>
		<a href="javascript:void(0)">忘记密码</a> 
		<input class='submitlogin' type="submit"  value="登陆">
	</p>
	</form>	
</div>		
</body>
</html>